<template>
	<view class="">
		<navbar :title="systemInfo.navTitle"></navbar>
	</view>
	<view class="content" :style="{minHeight:systemInfo.contentHeight}">
		<view class="main">
		</view>
	</view>
</template>

<script setup lang="ts">
	import { loginOutApi } from '@/helper/apis/books.js';
	import navbar from "@/components/navbar.vue"
	import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
	import { getCurrentInstance, reactive, ref } from 'vue';
	const { proxy } = getCurrentInstance()
	const token = ref<any>()
	// 系统配置类
	class SystemInfo {
		info : object = {}
		statusBarHeight : string | number | undefined = ''
		contentHeight : string | number = ''
		navTitle : string = '首页'
		getSize(info : any) {
			this.statusBarHeight = (info.statusBarHeight + 44) * 2
			this.contentHeight = `calc(100vh - ${this.statusBarHeight + 76}rpx)`
		}
		constructor() {
		}
	}
	const systemInfo = ref(new SystemInfo())
	onLoad(async () : Promise<any> => {
		token.value = uni.getStorageSync('token')
		// 系统样式相关
		systemInfo.value.info = await proxy.$gloab.getSystemInfo()
		systemInfo.value.getSize(systemInfo.value.info)
	})
	// 判断是否登录
	const islogin = () : boolean => {
		if (!token.value) {
			return false
		}
		return true
	}
	// 定位相关
	interface LocationValue {
		latitude : string | number,
		longitude : string | number
	}
	const location = reactive<LocationValue>({
		latitude: 0,
		longitude: 0
	})
	const getLocation = () : void => {
		location.latitude = 31.16
		location.longitude = 116.31
	}
</script>

<style lang="less">
	.content {
		background: #f5f5f5;
		padding: 20rpx;
		padding-bottom: 64rpx;
	}
</style>